Chris Pollett > Old Classes >
CS174

( Print View )

Student Corner:
  [Grades Sec1]
  [Grades Sec2]
  [Grades Sec3]

  [Submit Sec1]
  [Submit Sec2]
  [Submit Sec3]

  [Class Sign Up Sec1]
  [Class Sign Up Sec2]
  [Class Sign Up Sec3]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












CS174 Fall 2007Practice Midterm 1

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test.

[Student Generated Solutions]

1. Write an example .htaccess file that could be used to password protect a directory.

2. Explain the difference between HTML meta tags of the form <meta name="" ... > and those of the form <meta http-equiv="" ... >. Give a practical example of using each variant.

3. Explain the difference between CSS class selectors, id selectors, and pseudo-classes. Give a code example for each.

4. Explain with a diagram what is controlled by the cellspacing and cellpadding attributes of the HTML table tag. Write a simple HTML form that could be used to upload a file.

5. Suppose one has a web page which when rendered has on it only a single button with the words "Click me". When this button is clicked a Javascript function called foo() is called that executes the single command document.writeln("<p>hi there</p>"). Draw a complete picture of what the page would look like after this function executes.

6. Explain what a Function object's prototype property is. Give an example (with code) of how this property is used.

7. Write a short Javascript function pennyEarned(str) which takes the string passed to it and replaces the third occurrence of the string "penny saved" with "PENNY EARNED" and returns the result. Your program should make use of Javascript pattern matching to do the conversion.

8. You are given an arbitrary short XHTML 1.1 page with a web form on it. The submit button of this form calls a Javascript function foo(). Your job is to write this function foo(), so that the form is only submitted if the first element on the form has a value which only consists of numbers between 0-9.

9. Explain with a short code example how to set up a function in Javascript so that it will be called every 1/2 second.

10. You are charged with creating an XML language to specify coin collections. Write a short DTD for this language (you should make constructive use of <!ELEMENT ... >'s, <!ATTLIST ... >'s and <!ENTITY... >'s). Create an example document that makes use of your new language.